function avgOnlineTime() {
    $.get('/admin/visual/avg_online_time').done(function (data) {
        var myChart = echarts.init(document.getElementById('avg_online_time'));
        myChart.setOption ({
            title : {
                text: '过去30天平均在线时长',
                subtext: data.time_start + ' ~ ' + data.time_end,
            },
            tooltip : {
                trigger: 'axis'
            },
            legend: {
                data:['会员','游客']
            },
            toolbox: {
                show : true,
                feature : {
                    dataView : {show: true, readOnly: false},
                    magicType : {show: true, type: ['line', 'bar']},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            calculable : true,
            xAxis : [
                {
                    type : 'category',
                    data : data.time
                }
            ],
            yAxis : [
                {
                    type : 'value',
                    axisLabel: {
                        formatter: '{value} 分钟'
                    }
                }
            ],
            series : [
                {
                    name:'会员',
                    type:'bar',
                    data:data.user
                },
                {
                    name:'游客',
                    type:'bar',
                    data:data.guest
                }
            ]
        });
        window.onresize = myChart.resize;
    })
};

